<template>
  <div id="app">
    state的数据:{{ $store.state.count }}
    <div>state的数据：{{ count }}</div>
    <div>{{ count1 }}</div>
    <div></div>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  computed: {
    ...mapState(["count1"]),
    count() {
      return (this.$store.state.count = 3);
    },
  },
  mutations: {
    addcount(state) {
      state.count += 1;
    },
  },
};
</script>

<style lang="less">
</style>
